package com.sx.zongzhi.presenter;

import com.sx.zongzhi.MyApplication;
import com.sx.zongzhi.bean.MainPagerBean;
import com.sx.zongzhi.modle.ApiManager;
import com.sx.zongzhi.net.BaseCallBack;
import com.sx.zongzhi.net.BaseResult;
import com.sx.zongzhi.view.IMainPagerView;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by XZY on 2017/11/30.
 * 首页统计数据
 */
public class MainPagerPest {

    private IMainPagerView iMainPagerView;

    public MainPagerPest(IMainPagerView iMainPagerView) {
        this.iMainPagerView=iMainPagerView;
    }

    public void getMainPager(String orgCode){
        Map<String,Object> map=new HashMap<>();
        map.put("sid", MyApplication.sid);
        map.put("orgCode",orgCode);
        new ApiManager().getMainPager(map, new BaseCallBack<BaseResult<MainPagerBean>>() {
            @Override
            public void onSuccess(BaseResult<MainPagerBean> response) {
                iMainPagerView.getMainPager(response.getData());
            }
            @Override
            public void onFailures(String message) {
                iMainPagerView.showError(message);
            }
        });
    }
}
